package com.cf.super_hero.serve.impl;

import com.cf.super_hero.entity.Form;
import com.cf.super_hero.mapper.LoginMapper;
import com.cf.super_hero.serve.LoginInterfaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class LoginService implements LoginInterfaceService {
    @SuppressWarnings("all")
    @Autowired
    LoginMapper heroMapper;

    @Override
    public boolean login(Form form) {
        List<Form> list=new ArrayList<>();
        list=heroMapper.login(form.getName(),form.getPassword());
        if(list.size()==1){
            return true;
        }
        return false;
    }
}
